package chaozuo;

import shu.Booklist;

import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 18128
 * Date: 2023-09-24
 * Time: 12:50
 */
public class jie implements CZJK{
    public void work(Booklist booklist)
    {
//        System.out.println("借阅图书");
        System.out.println("请输入要借阅的书名");
        Scanner scan=new Scanner(System.in);
        String s=scan.nextLine();
        int biaoji=-1;
        for (int i = 0; i < booklist.getNum(); i++) {
            if(s.equals(booklist.getBrr(i).getName()))
            {
                biaoji=i;
            }

        }
        if(biaoji==-1)
        {
            System.out.println("没有要借阅的这本书");
            return ;
        }
        booklist.getBrr(biaoji).setIsborrow(true);
        System.out.println("借阅成功");
    }
}
